<script th:inline="javascript">
    /*<![CDATA[*/

    var policyPattern = /*[[${policyPattern}]]*/;

    /*]]>*/
</script>

<div class="alert alert-info">
    <h2 th:utext="${expiredPass} ? #{screen.expiredpass.heading} : #{screen.mustchangepass.heading}"/>
    <p/>
    <br/>

    <form id="passwordManagementForm" th:if="${passwordManagementEnabled}" method="post" th:object="${password}">
        <p>
        <div class="alert alert-danger" th:if="${#fields.hasErrors('*')}">
            <span th:each="err : ${#fields.errors('*')}" th:utext="${err}"/>
        </div>


        <table>
            <tr>
                <td class="pm">
                    <label for="password" th:utext="#{screen.pm.enterpsw}"/>&nbsp;
                </td>
                <td class="pm">
                    <input class="required form-control form-control-lg" type="password" id="password" th:field="*{password}"/>
                </td>
            </tr>

            <tr>
                <td class="pm">
                    <label for="confirmedPassword" th:utext="#{screen.pm.confirmpsw}"/>&nbsp;
                </td>
                <td class="pm">
                    <input class="required form-control form-control-lg" type="password" id="confirmedPassword" th:field="*{confirmedPassword}"/>
                </td>
            </tr>
        </table>
     

        <div>
            <br/>
            <div class="progress">
                <div id="strengthProgressBar" class="progress-bar"></div>
            </div>
        </div>
        </p>
        <p id="password-strength-text"></p>

        <p align="center">
            <input type="hidden" name="execution" th:value="${flowExecutionKey}"/>
            <input type="hidden" name="_eventId" value="submit"/>
            <input class="btn btn-success btn-lg"
                   name="submit"
                   accesskey="s"
                   th:value="#{screen.pm.button.submit}"
                   id="submit"
                   type="submit" 
                   disabled="true"/>
            &nbsp;
            <input
                    class="btn btn-danger btn-lg"
                    name="cancel"
                    accesskey="c"
                    th:value="#{screen.pm.button.cancel}"
                    type="button"
                    onclick="location.href = location.href;"/>
        </p>
    </form>
    <p th:unless="${passwordManagementEnabled}" th:utext="${expiredPass} ? #{screen.expiredpass.message} : #{screen.mustchangepass.message}"/>
</div>
